<?php 

class advice_model extends CI_Model
{
	function __construct()
	{
		parent::__construct();	
	}
	
	function get_advice($num=5)
	{
		$this->db->where('active',1);
		return $this->db->get('advice',$num)->result();
	}
	
	function get_count_news()
	{
		$this->db->where('active',1);
		return $this->db->get('advice')->num_rows();
	}
	
	function getID($id)
	{
		$this->db->where('tv_id',$id);
		return $this->db->get('advice')->row();	
	}

	
}
?>
